import request from "@/utils/request.js";

const userApi = {
    profile() {
        return request.get('/sysUser/profile')
    },
    create(data) {
        return request.post('/sysUser', data)
    },
    delete(id) {
        return request.delete(`/sysUser/${id}`)
    },
    deleteBatch(ids) {
        return request.delete(`/sysUser/batch`, {
            params: {
                ids: ids.join(',')
            }
        })
    },
    lock(id) {
        return request.put(`/sysUser/${id}/lock`)
    },
    unlock(id) {
        return request.put(`/sysUser/${id}/unlock`)
    },
    update(data) {
        return request.put('/sysUser', data)
    },
    updatePassword(data) {
        return request.put('/sysUser/password', data)
    },
    resetPassword(id) {
        return request.put(`/sysUser/resetPassword/${id}`)
    },
    info(id) {
        return request.get(`/sysUser/info/${id}`)
    },
    page(params) {
        return request.get('/sysUser/page', {params})
    },

}

export default userApi